Fix terminal Cmd+Backspace on macOS#2027
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
After: Screen.Recording.2026-04-14.at.10.39.27.PM.mov |
ApprovabilityVerdict: Approved A small, well-tested bug fix adding Cmd+Backspace support for macOS terminal input. The implementation follows existing keyboard shortcut patterns exactly, includes comprehensive unit tests, and has no security or infrastructure implications. You can customize Macroscope's approvability policy. Learn more. |
Integrates upstream/main (d22c6f5) into the fork while preserving all multi-provider support (codex, claudeAgent, copilot, cursor, opencode, geminiCli, amp, kilo) and fork UI/UX additions. Highlights adopted from upstream: - Nightly release channel + update channel selector (pingdotgg#2012, pingdotgg#2049, pingdotgg#1969) - Filesystem browse API + command palette project picker (pingdotgg#2024) - Launch Args setting for Claude provider (pingdotgg#1971) - Kiro editor support in open picker (pingdotgg#1974) - Claude plan events for TodoWrite during input streaming (pingdotgg#1541) - Lost provider session recovery (pingdotgg#1938) - Cache provider status and gate desktop startup (pingdotgg#1962) - LegendList migration for chat scrolling and branch lists (pingdotgg#1953) - Shell snapshot queries + backfill migration (pingdotgg#1973, pingdotgg#2004) - PATH hydration + fallback detection (pingdotgg#1799) - Warm sidebar thread subscriptions (pingdotgg#2001) - Full thread title tooltip (pingdotgg#1994) - Markdown file link UX (pingdotgg#1956), composer polish (pingdotgg#1944, pingdotgg#1992, pingdotgg#1985) - Worktree/branch state + draft reuse fixes (pingdotgg#2005, pingdotgg#2003, pingdotgg#1995, pingdotgg#1936) - Window controls overlay for Windows/Linux (pingdotgg#1969) - Backend readiness timeout 10s→30s (pingdotgg#1979) - Clear tracked RPCs on reconnect, live stream subscriptions (pingdotgg#2000, pingdotgg#1972) - Various misc fixes (pingdotgg#2051, pingdotgg#2052, pingdotgg#2025, pingdotgg#2027, pingdotgg#2049, pingdotgg#1997, pingdotgg#1975) Fork features preserved and reconciled: - All 8 provider adapters + conformance tests - Extended ProviderKind union across contracts/model/settings/provider - appearance/accentColor/themeConfig/ProviderLogo UI system - customModels + gitTextGeneration + providerModelOptions - Migration IDs 23 (NormalizeLegacyProviderKinds) and 24 (RepairProjectionThreadProposedPlanImplementationColumns) kept; new upstream migrations registered at IDs 25-26 to avoid breaking deployed fork databases - DesktopBridge: log directory channels (LOG_DIR/LIST/READ/OPEN_DIR) retained; getWsUrl replaced by upstream's getAppBranding - PROVIDER_CACHE_IDS extended to all 8 providers
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Summary
map macOS Cmd+Backspace in the terminal to the standard delete-to-start-of-line control sequence
route that shortcut through the existing terminal write path so it stays inside xterm instead of falling through to app shortcuts
add regression coverage for the shortcut helper across macOS and reject cases
Root cause
The terminal drawer did not intercept Cmd+Backspace on macOS, so the shortcut never reached the terminal as the expected Ctrl+U sequence.
Validation
Issue
Closes #1976
bun fmt apps/web/src/keybindings.ts apps/web/src/components/ThreadTerminalDrawer.tsx apps/web/src/keybindings.test.tsbun lintbun typecheck(currently fails upstream inapps/server/src/provider/Layers/ClaudeAdapter.tswith unrelated TS2367 comparisons)Note
Low Risk
Low risk: adds a macOS-only keybinding mapping and routes it through the existing terminal input path, with focused unit tests to prevent regressions.
Overview
Ensures
Cmd+Backspacein the in-app terminal on macOS performs delete-to-line-start by mapping it to the^U(\u0015) control sequence.Adds
terminalDeleteShortcutDatainkeybindings.tsand intercepts it inThreadTerminalDrawer’s xterm custom key handler so the sequence is sent via the existingsendTerminalInputpath (preventing the shortcut from falling through to app-level bindings), with new unit tests covering supported and rejected cases.Reviewed by Cursor Bugbot for commit b958844. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Cmd+Backspace delete-to-line-start shortcut in terminal on macOS
Adds a
terminalDeleteShortcutDatafunction in keybindings.ts that maps Cmd+Backspace on macOS keydown events to the^Ucontrol sequence (\u0015), returningnullfor all other platforms or modifier combinations. The ThreadTerminalDrawer intercepts this shortcut in the custom key event handler and sends the sequence to the backend viasendTerminalInput.Macroscope summarized b958844.